﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
using Sharp.Infrastructure.AutoMapper;
using Sharp.Infrastructure.Interfaces;

namespace Sharp.WebBooter
{
    public class Bootstraper : IBootstrapPlugin
    {
        public Bootstraper()
        {
            Order = 999;
        }

        public Assembly[] StartupAssembles { get; set; }
        public int Order { get; set; }
        public bool IsAlready { get; set; }

        public void Initialize()
        {

        }

        public Task InitializeAsync()
        {
            return Task.Run(() =>
            {
                new AutoMapperInitialize().Initialize(this.StartupAssembles);

                //Mapper.AssertConfigurationIsValid();

                if (ConfigurationManager.AppSettings["InitPermissionData"].IsNotNullOrEmpty())
                {

                }
            });
        }
    }
}